package com.ctshk.sapp.order.ship.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.order.ship.dto.ShipOrderTouristDTO;
import com.ctshk.rpc.order.ship.req.ShipOrderTouristModifyReq;
import com.ctshk.rpc.order.ship.req.ShipOrderTouristReq2;
import com.ctshk.rpc.order.ship.service.IShipOrderTouristService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 旅客信息 用于订单详情-旅客信息
 * @Description
 * @Author wansi <gaylen15527491065@yeah.net>
 * @Date 2021/5/6
 */
@RestController
@RequestMapping("/ship-order-tourist")
public class ShipOrderTouristController extends BaseController {

    @DubboReference
    private IShipOrderTouristService iShipOrderTouristService;

    @ApiOperation(value = "订单中心旅客列表", notes = "订单中心旅客列表")
    @OperationLogAnnotation(operModul = OperationLogModel.SHIP_ORDER, operType = OperationLogType.QUERY, operTitle = "订单中心旅客列表", operDesc = "订单中心旅客列表")
    @PostMapping(value = "/list")
    public Result<List<ShipOrderTouristDTO>> list(@RequestBody ShipOrderTouristReq2 localFunOrderTouristReq) {
        return iShipOrderTouristService.list(localFunOrderTouristReq,getCurrentUser());
    }

    @ApiOperation(value = "修改旅客信息", notes = "修改旅客信息")
    @OperationLogAnnotation(operModul = OperationLogModel.SHIP_ORDER, operType = OperationLogType.UPDATE, operTitle = "修改旅客信息", operDesc = "修改旅客信息")
    @PostMapping(value = "/modify")
    public Result modify(@RequestBody ShipOrderTouristModifyReq shipOrderTouristModifyReq){
        return iShipOrderTouristService.modify(shipOrderTouristModifyReq,getCurrentUser(getRequest()));
    }
}

